<template>
  <el-dialog
    draggable
    overflow
    :title="'查看工艺'"
    v-model="visible"
    :width="800"
    destroy-on-close
  >
    <el-form
      :model="form"
      :rules="rules"
      ref="dialogForm"
      label-width="80px"
      label-position="right"
    >
      <el-row>
        <el-col :span="24">
          <el-form-item label="工艺BOM" prop="bom_id">
            <el-input v-model="form.bom.name" disabled></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <sc-VxeTable
            ref="xGrid1"
            :gridEvts="gridEvents"
            :gridOps="gridOps"
            :data="form.raws"
            :tablecode="'market_pro_process_view'"
          >
          </sc-VxeTable>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="visible = false">取 消</el-button>
      <!-- <el-button type="primary" :loading="isSaveing" @click="submit()">保 存</el-button> -->
    </template>
  </el-dialog>
</template>

<script>
export default {
  emits: [],
  components: {},
  data() {
    return {
      gridEvents: {},
      gridOps: { height: 300 },
      visible: false,
      form: {
        raws: [],
        bom: {},
      },
    };
  },
  mounted() {},
  methods: {
    open() {
      this.visible = true;
      return this;
    },
    setData(batchno) {
      this.getData(batchno);
      return this;
    },

    getData(batchno) {
      this.$API.pro.OpenCard.craft
        .get({ filter: [{ "details.batchno": { type: "eq", value: batchno } }] })
        .then(res => {
          Object.assign(this.form, this.$TOOL.removeNull(res.data));
        });
    },
  },
};
</script>
